#ifndef __HMI_CORE_H_
#define __HMI_CORE_H_

//=======================================================================//
//= Include files.													    =//
//=======================================================================//
#include "HMI_Engine.h"
#include <stdlib.h>
#include <stdio.h>
#include "SGUI_Typedef.h"
#include "SGUI_Common.h"
#include "DemoActions.h"
#include "Resource.h"
#ifdef _SIMPLE_GUI_IN_VIRTUAL_SDK_
//#include "SDKInterface.h"
#endif

//=======================================================================//
//= Data type definition.											    =//
//=======================================================================//
// HMI action type
typedef enum
{
	EVENT_ID_UNKNOW =				0x00,
	// User defined action type.
	EVENT_ID_KEY_PRESS = 0x01,
	EVENT_ID_TIMER = 0x02,
	EVENT_ID_RTC = 0x04,
	// User defined action above.
	EVENT_ID_MAX
}EVENT_ID;

// HMI event type.
typedef enum
{
    EVENT_TYPE_ANY =				0x00,
    EVENT_TYPE_ACTION = 0x01,
    EVENT_TYPE_DATA = 0x02,
}EVENT_TYPE;

enum DEMO_PROC_ACTION_ID
{
    HMI_DEMO_PROC_NO_ACT =			0,
    HMI_DEMO_PROC_CONFIRM =			1,
    HMI_DEMO_PROC_CANCEL =			2,
};

typedef struct
{
	SGUI_UINT32		uiKeyValue;
}KEY_EVENT_DATA;

typedef struct
{
	SGUI_INT		iValue;
}DUMMY_DATA_EVENT_DATA;

HMI_EVENT_TYPE_DECLARE(KEY_PRESS_EVENT, KEY_EVENT_DATA)
HMI_EVENT_TYPE_DECLARE(DATA_EVENT, DUMMY_DATA_EVENT_DATA);

//=======================================================================//
//= User Macro definition.											    =//
//=======================================================================//
#define		HMI_SCREEN_ID_DEMO_SCROLLING_TEXT			(1001)
#define		HMI_SCREEN_ID_DEMO_PAINT_TEXT					(1002)
#define		HMI_SCREEN_ID_DEMO_LIST								(1003)
#define		HMI_SCREEN_ID_DEMO_TEXT_NOTICE				(1004)
#define		HMI_SCREEN_ID_DEMO_BASIC_PAINT				(1005)
#define		HMI_SCREEN_ID_DEMO_VARIABLE_BOX				(1006)
#define		HMI_SCREEN_ID_DEMO_REAL_TIME_GRAPH		(1007)
#define		HMI_SCREEN_ID_DEMO_MENU								(1008)
#define		HMI_SCREEN_ID_VARIABLE_LIST						(1009)
#define		HMI_SCREEN_ID_INPUT_INT_BOX						(1010)
#define		HMI_SCREEN_ID_VARIABLE_INPUT_INIT_LIST (1011)
#define		HMI_SCREEN_ID_VARIABLE_INPUT_FLOAT		(1012)

#define 	DEMO_HEART_BEAT_INTERVAL_MS						(20)

//=======================================================================//
//= Public variable declaration.									    =//
//=======================================================================//
/* HMI engine object. */
extern HMI_ENGINE_OBJECT        g_stDemoEngine;
/* Screen display objects. */
extern HMI_SCREEN_OBJECT        g_stHMIDemo_ScrollingText;
extern HMI_SCREEN_OBJECT				g_stHMIDemo_List;
extern HMI_SCREEN_OBJECT				g_stHMIDemo_Notice;
extern HMI_SCREEN_OBJECT				g_stHMIDemo_RTCNotice;
extern HMI_SCREEN_OBJECT        g_stHMIDemo_VariableBox;
extern HMI_SCREEN_OBJECT				g_stHMIDemo_RealtimeGraph;
extern HMI_SCREEN_OBJECT				g_stHMIDemo_Menu;
extern HMI_SCREEN_OBJECT				g_stHMIDemo_BasicPaint;
extern HMI_SCREEN_OBJECT				g_stHMIDemo_TextPaint;
extern HMI_SCREEN_OBJECT				g_stHMIVariable_List;
extern HMI_SCREEN_OBJECT				g_stHMI_InputIntBox;
extern HMI_SCREEN_OBJECT				g_stHMIVariableInputInit_List;
extern HMI_SCREEN_OBJECT        g_stHMI_InputFloatBox;
//=======================================================================//
//= Function declare.   											    =//
//=======================================================================//
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
HMI_ENGINE_RESULT	InitializeHMIEngineObj(void);
void				DemoMainProcess(void);

bool				SysTickTimerTriggered(void);
bool				RTCTimerTriggered(void);
bool				UserEventTriggered(void);

//void				SysTickTimerEnable(bool bEnable);
//void				RTCTimerEnable(bool bEnable);

#ifdef __cplusplus
}
#endif /* __cplusplus */

    HMI_ENGINE_RESULT InitHMIEngineObj();
    void HMI_Work();



#endif
